home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / mx / controls / SWFLoader.as < prev    next >
Text File  |  2009-12-16  |  46KB  |  1,379 lines

  1. package mx.controls
  2. {
  3.    import flash.display.Bitmap;
  4.    import flash.display.DisplayObject;
  5.    import flash.display.DisplayObjectContainer;
  6.    import flash.display.Loader;
  7.    import flash.display.LoaderInfo;
  8.    import flash.display.Sprite;
  9.    import flash.events.Event;
  10.    import flash.events.EventDispatcher;
  11.    import flash.events.HTTPStatusEvent;
  12.    import flash.events.IEventDispatcher;
  13.    import flash.events.IOErrorEvent;
  14.    import flash.events.MouseEvent;
  15.    import flash.events.ProgressEvent;
  16.    import flash.events.SecurityErrorEvent;
  17.    import flash.geom.Point;
  18.    import flash.geom.Rectangle;
  19.    import flash.net.URLRequest;
  20.    import flash.system.ApplicationDomain;
  21.    import flash.system.Capabilities;
  22.    import flash.system.LoaderContext;
  23.    import flash.system.SecurityDomain;
  24.    import flash.utils.ByteArray;
  25.    import mx.core.Application;
  26.    import mx.core.FlexLoader;
  27.    import mx.core.FlexVersion;
  28.    import mx.core.IFlexDisplayObject;
  29.    import mx.core.ISWFLoader;
  30.    import mx.core.IUIComponent;
  31.    import mx.core.UIComponent;
  32.    import mx.core.mx_internal;
  33.    import mx.events.FlexEvent;
  34.    import mx.events.InterManagerRequest;
  35.    import mx.events.InvalidateRequestData;
  36.    import mx.events.SWFBridgeEvent;
  37.    import mx.events.SWFBridgeRequest;
  38.    import mx.managers.CursorManager;
  39.    import mx.managers.ISystemManager;
  40.    import mx.managers.SystemManagerGlobals;
  41.    import mx.styles.ISimpleStyleClient;
  42.    import mx.utils.LoaderUtil;
  43.    
  44.    use namespace mx_internal;
  45.    
  46.    public class SWFLoader extends UIComponent implements ISWFLoader
  47.    {
  48.       
  49.       mx_internal static const VERSION:String = "3.5.0.12683";
  50.        
  51.       
  52.       private var _loadForCompatibility:Boolean = false;
  53.       
  54.       private var _loaderContext:LoaderContext;
  55.       
  56.       private var requestedURL:URLRequest;
  57.       
  58.       private var _swfBridge:IEventDispatcher;
  59.       
  60.       private var _bytesTotal:Number = NaN;
  61.       
  62.       private var useUnloadAndStop:Boolean;
  63.       
  64.       private var flexContent:Boolean = false;
  65.       
  66.       private var explicitLoaderContext:Boolean = false;
  67.       
  68.       private var resizableContent:Boolean = false;
  69.       
  70.       private var brokenImageBorder:IFlexDisplayObject;
  71.       
  72.       private var _source:Object;
  73.       
  74.       private var _maintainAspectRatio:Boolean = true;
  75.       
  76.       private var mouseShield:Sprite;
  77.       
  78.       private var contentRequestID:String = null;
  79.       
  80.       private var _smoothBitmapContent:Boolean = false;
  81.       
  82.       mx_internal var contentHolder:DisplayObject;
  83.       
  84.       private var brokenImage:Boolean = false;
  85.       
  86.       private var _bytesLoaded:Number = NaN;
  87.       
  88.       private var _autoLoad:Boolean = true;
  89.       
  90.       private var _showBusyCursor:Boolean = false;
  91.       
  92.       private var _scaleContent:Boolean = true;
  93.       
  94.       private var isContentLoaded:Boolean = false;
  95.       
  96.       private var unloadAndStopGC:Boolean;
  97.       
  98.       private var smoothBitmapContentChanged:Boolean = false;
  99.       
  100.       private var _trustContent:Boolean = false;
  101.       
  102.       private var attemptingChildAppDomain:Boolean = false;
  103.       
  104.       private var scaleContentChanged:Boolean = false;
  105.       
  106.       private var contentChanged:Boolean = false;
  107.       
  108.       public function SWFLoader()
  109.       {
  110.          super();
  111.          tabChildren = true;
  112.          tabEnabled = false;
  113.          addEventListener(FlexEvent.INITIALIZE,initializeHandler);
  114.          addEventListener(Event.ADDED_TO_STAGE,addedToStageHandler);
  115.          addEventListener(MouseEvent.CLICK,clickHandler);
  116.          showInAutomationHierarchy = false;
  117.       }
  118.       
  119.       public function get contentHeight() : Number
  120.       {
  121.          return !!mx_internal::contentHolder ? Number(mx_internal::contentHolder.height) : Number(NaN);
  122.       }
  123.       
  124.       [Bindable("trustContentChanged")]
  125.       public function get trustContent() : Boolean
  126.       {
  127.          return _trustContent;
  128.       }
  129.       
  130.       public function set trustContent(param1:Boolean) : void
  131.       {
  132.          if(_trustContent != param1)
  133.          {
  134.             _trustContent = param1;
  135.             invalidateProperties();
  136.             invalidateSize();
  137.             invalidateDisplayList();
  138.             dispatchEvent(new Event("trustContentChanged"));
  139.          }
  140.       }
  141.       
  142.       [Bindable("maintainAspectRatioChanged")]
  143.       public function get maintainAspectRatio() : Boolean
  144.       {
  145.          return _maintainAspectRatio;
  146.       }
  147.       
  148.       private function doScaleContent() : void
  149.       {
  150.          var interiorWidth:Number = NaN;
  151.          var interiorHeight:Number = NaN;
  152.          var contentWidth:Number = NaN;
  153.          var contentHeight:Number = NaN;
  154.          var x:Number = NaN;
  155.          var y:Number = NaN;
  156.          var newXScale:Number = NaN;
  157.          var newYScale:Number = NaN;
  158.          var scale:Number = NaN;
  159.          var w:Number = NaN;
  160.          var h:Number = NaN;
  161.          var holder:Loader = null;
  162.          var sizeSet:Boolean = false;
  163.          var lInfo:LoaderInfo = null;
  164.          if(!isContentLoaded)
  165.          {
  166.             return;
  167.          }
  168.          if(!resizableContent || maintainAspectRatio && !flexContent)
  169.          {
  170.             unScaleContent();
  171.             interiorWidth = unscaledWidth;
  172.             interiorHeight = unscaledHeight;
  173.             contentWidth = contentHolderWidth;
  174.             contentHeight = contentHolderHeight;
  175.             x = 0;
  176.             y = 0;
  177.             newXScale = contentWidth == 0 ? Number(1) : Number(interiorWidth / contentWidth);
  178.             newYScale = contentHeight == 0 ? Number(1) : Number(interiorHeight / contentHeight);
  179.             if(_maintainAspectRatio)
  180.             {
  181.                if(newXScale > newYScale)
  182.                {
  183.                   x = Math.floor((interiorWidth - contentWidth * newYScale) * getHorizontalAlignValue());
  184.                   scale = newYScale;
  185.                }
  186.                else
  187.                {
  188.                   y = Math.floor((interiorHeight - contentHeight * newXScale) * getVerticalAlignValue());
  189.                   scale = newXScale;
  190.                }
  191.                mx_internal::contentHolder.scaleX = scale;
  192.                mx_internal::contentHolder.scaleY = scale;
  193.             }
  194.             else
  195.             {
  196.                mx_internal::contentHolder.scaleX = newXScale;
  197.                mx_internal::contentHolder.scaleY = newYScale;
  198.             }
  199.             mx_internal::contentHolder.x = x;
  200.             mx_internal::contentHolder.y = y;
  201.          }
  202.          else
  203.          {
  204.             mx_internal::contentHolder.x = 0;
  205.             mx_internal::contentHolder.y = 0;
  206.             w = unscaledWidth;
  207.             h = unscaledHeight;
  208.             if(mx_internal::contentHolder is Loader)
  209.             {
  210.                holder = Loader(mx_internal::contentHolder);
  211.                try
  212.                {
  213.                   if(getContentSize().x > 0)
  214.                   {
  215.                      sizeSet = false;
  216.                      if(holder.contentLoaderInfo.contentType == "application/x-shockwave-flash")
  217.                      {
  218.                         if(childAllowsParent)
  219.                         {
  220.                            if(holder.content is IFlexDisplayObject)
  221.                            {
  222.                               IFlexDisplayObject(holder.content).setActualSize(w,h);
  223.                               sizeSet = true;
  224.                            }
  225.                         }
  226.                         if(!sizeSet && swfBridge)
  227.                         {
  228.                            swfBridge.dispatchEvent(new SWFBridgeRequest(SWFBridgeRequest.SET_ACTUAL_SIZE_REQUEST,false,false,null,{
  229.                               "width":w,
  230.                               "height":h
  231.                            }));
  232.                            sizeSet = true;
  233.                         }
  234.                      }
  235.                      if(!sizeSet)
  236.                      {
  237.                         lInfo = holder.contentLoaderInfo;
  238.                         if(lInfo)
  239.                         {
  240.                            mx_internal::contentHolder.scaleX = w / lInfo.width;
  241.                            mx_internal::contentHolder.scaleY = h / lInfo.height;
  242.                         }
  243.                         else
  244.                         {
  245.                            mx_internal::contentHolder.width = w;
  246.                            mx_internal::contentHolder.height = h;
  247.                         }
  248.                      }
  249.                   }
  250.                   else if(childAllowsParent && !(holder.content is IFlexDisplayObject))
  251.                   {
  252.                      mx_internal::contentHolder.width = w;
  253.                      mx_internal::contentHolder.height = h;
  254.                   }
  255.                }
  256.                catch(error:Error)
  257.                {
  258.                   mx_internal::contentHolder.width = w;
  259.                   mx_internal::contentHolder.height = h;
  260.                }
  261.                if(!parentAllowsChild)
  262.                {
  263.                   mx_internal::contentHolder.scrollRect = new Rectangle(0,0,w / mx_internal::contentHolder.scaleX,h / mx_internal::contentHolder.scaleY);
  264.                }
  265.             }
  266.             else
  267.             {
  268.                mx_internal::contentHolder.width = w;
  269.                mx_internal::contentHolder.height = h;
  270.             }
  271.          }
  272.       }
  273.       
  274.       private function unScaleContent() : void
  275.       {
  276.          mx_internal::contentHolder.scaleX = 1;
  277.          mx_internal::contentHolder.scaleY = 1;
  278.          mx_internal::contentHolder.x = 0;
  279.          mx_internal::contentHolder.y = 0;
  280.       }
  281.       
  282.       public function set maintainAspectRatio(param1:Boolean) : void
  283.       {
  284.          _maintainAspectRatio = param1;
  285.          dispatchEvent(new Event("maintainAspectRatioChanged"));
  286.       }
  287.       
  288.       override public function regenerateStyleCache(param1:Boolean) : void
  289.       {
  290.          var sm:ISystemManager = null;
  291.          var recursive:Boolean = param1;
  292.          super.regenerateStyleCache(recursive);
  293.          try
  294.          {
  295.             sm = content as ISystemManager;
  296.             if(sm != null)
  297.             {
  298.                Object(sm).regenerateStyleCache(recursive);
  299.             }
  300.          }
  301.          catch(error:Error)
  302.          {
  303.          }
  304.       }
  305.       
  306.       private function get contentHolderHeight() : Number
  307.       {
  308.          var loaderInfo:LoaderInfo = null;
  309.          var content:IFlexDisplayObject = null;
  310.          var bridge:IEventDispatcher = null;
  311.          var request:SWFBridgeRequest = null;
  312.          var testContent:DisplayObject = null;
  313.          if(mx_internal::contentHolder is Loader)
  314.          {
  315.             loaderInfo = Loader(mx_internal::contentHolder).contentLoaderInfo;
  316.          }
  317.          if(loaderInfo)
  318.          {
  319.             if(loaderInfo.contentType == "application/x-shockwave-flash")
  320.             {
  321.                try
  322.                {
  323.                   if(systemManager.swfBridgeGroup)
  324.                   {
  325.                      bridge = swfBridge;
  326.                      if(bridge)
  327.                      {
  328.                         request = new SWFBridgeRequest(SWFBridgeRequest.GET_SIZE_REQUEST);
  329.                         bridge.dispatchEvent(request);
  330.                         return request.data.height;
  331.                      }
  332.                   }
  333.                   content = Loader(mx_internal::contentHolder).content as IFlexDisplayObject;
  334.                   if(content)
  335.                   {
  336.                      return content.measuredHeight;
  337.                   }
  338.                }
  339.                catch(error:Error)
  340.                {
  341.                   return mx_internal::contentHolder.height;
  342.                }
  343.             }
  344.             else
  345.             {
  346.                try
  347.                {
  348.                   testContent = Loader(mx_internal::contentHolder).content;
  349.                }
  350.                catch(error:Error)
  351.                {
  352.                   return mx_internal::contentHolder.height;
  353.                }
  354.             }
  355.             return loaderInfo.height;
  356.          }
  357.          if(mx_internal::contentHolder is IUIComponent)
  358.          {
  359.             return IUIComponent(mx_internal::contentHolder).getExplicitOrMeasuredHeight();
  360.          }
  361.          if(mx_internal::contentHolder is IFlexDisplayObject)
  362.          {
  363.             return IFlexDisplayObject(mx_internal::contentHolder).measuredHeight;
  364.          }
  365.          return mx_internal::contentHolder.height;
  366.       }
  367.       
  368.       [Bindable("loaderContextChanged")]
  369.       public function get loaderContext() : LoaderContext
  370.       {
  371.          return _loaderContext;
  372.       }
  373.       
  374.       public function set showBusyCursor(param1:Boolean) : void
  375.       {
  376.          if(_showBusyCursor != param1)
  377.          {
  378.             _showBusyCursor = param1;
  379.             if(_showBusyCursor)
  380.             {
  381.                CursorManager.registerToUseBusyCursor(this);
  382.             }
  383.             else
  384.             {
  385.                CursorManager.unRegisterToUseBusyCursor(this);
  386.             }
  387.          }
  388.       }
  389.       
  390.       override public function notifyStyleChangeInChildren(param1:String, param2:Boolean) : void
  391.       {
  392.          var sm:ISystemManager = null;
  393.          var styleProp:String = param1;
  394.          var recursive:Boolean = param2;
  395.          super.notifyStyleChangeInChildren(styleProp,recursive);
  396.          try
  397.          {
  398.             sm = content as ISystemManager;
  399.             if(sm != null)
  400.             {
  401.                Object(sm).notifyStyleChangeInChildren(styleProp,recursive);
  402.             }
  403.          }
  404.          catch(error:Error)
  405.          {
  406.          }
  407.       }
  408.       
  409.       private function getHorizontalAlignValue() : Number
  410.       {
  411.          var _loc1_:String = getStyle("horizontalAlign");
  412.          if(_loc1_ == "left")
  413.          {
  414.             return 0;
  415.          }
  416.          if(_loc1_ == "right")
  417.          {
  418.             return 1;
  419.          }
  420.          return 0.5;
  421.       }
  422.       
  423.       [Bindable("sourceChanged")]
  424.       public function get source() : Object
  425.       {
  426.          return _source;
  427.       }
  428.       
  429.       [Bindable("loadForCompatibilityChanged")]
  430.       public function get loadForCompatibility() : Boolean
  431.       {
  432.          return _loadForCompatibility;
  433.       }
  434.       
  435.       private function contentLoaderInfo_httpStatusEventHandler(param1:HTTPStatusEvent) : void
  436.       {
  437.          dispatchEvent(param1);
  438.       }
  439.       
  440.       [Bindable("autoLoadChanged")]
  441.       public function get autoLoad() : Boolean
  442.       {
  443.          return _autoLoad;
  444.       }
  445.       
  446.       public function set source(param1:Object) : void
  447.       {
  448.          if(_source != param1)
  449.          {
  450.             _source = param1;
  451.             contentChanged = true;
  452.             invalidateProperties();
  453.             invalidateSize();
  454.             invalidateDisplayList();
  455.             dispatchEvent(new Event("sourceChanged"));
  456.          }
  457.       }
  458.       
  459.       [Bindable("smoothBitmapContentChanged")]
  460.       public function get smoothBitmapContent() : Boolean
  461.       {
  462.          return _smoothBitmapContent;
  463.       }
  464.       
  465.       public function set loaderContext(param1:LoaderContext) : void
  466.       {
  467.          _loaderContext = param1;
  468.          explicitLoaderContext = true;
  469.          dispatchEvent(new Event("loaderContextChanged"));
  470.       }
  471.       
  472.       private function get contentHolderWidth() : Number
  473.       {
  474.          var loaderInfo:LoaderInfo = null;
  475.          var content:IFlexDisplayObject = null;
  476.          var request:SWFBridgeRequest = null;
  477.          var testContent:DisplayObject = null;
  478.          if(mx_internal::contentHolder is Loader)
  479.          {
  480.             loaderInfo = Loader(mx_internal::contentHolder).contentLoaderInfo;
  481.          }
  482.          if(loaderInfo)
  483.          {
  484.             if(loaderInfo.contentType == "application/x-shockwave-flash")
  485.             {
  486.                try
  487.                {
  488.                   if(swfBridge)
  489.                   {
  490.                      request = new SWFBridgeRequest(SWFBridgeRequest.GET_SIZE_REQUEST);
  491.                      swfBridge.dispatchEvent(request);
  492.                      return request.data.width;
  493.                   }
  494.                   content = Loader(mx_internal::contentHolder).content as IFlexDisplayObject;
  495.                   if(content)
  496.                   {
  497.                      return content.measuredWidth;
  498.                   }
  499.                }
  500.                catch(error:Error)
  501.                {
  502.                   return mx_internal::contentHolder.width;
  503.                }
  504.             }
  505.             else
  506.             {
  507.                try
  508.                {
  509.                   testContent = Loader(mx_internal::contentHolder).content;
  510.                }
  511.                catch(error:Error)
  512.                {
  513.                   return mx_internal::contentHolder.width;
  514.                }
  515.             }
  516.             return loaderInfo.width;
  517.          }
  518.          if(mx_internal::contentHolder is IUIComponent)
  519.          {
  520.             return IUIComponent(mx_internal::contentHolder).getExplicitOrMeasuredWidth();
  521.          }
  522.          if(mx_internal::contentHolder is IFlexDisplayObject)
  523.          {
  524.             return IFlexDisplayObject(mx_internal::contentHolder).measuredWidth;
  525.          }
  526.          return mx_internal::contentHolder.width;
  527.       }
  528.       
  529.       [Bindable("progress")]
  530.       public function get bytesLoaded() : Number
  531.       {
  532.          return _bytesLoaded;
  533.       }
  534.       
  535.       private function removeInitSystemManagerCompleteListener(param1:LoaderInfo) : void
  536.       {
  537.          var _loc2_:EventDispatcher = null;
  538.          if(param1.contentType == "application/x-shockwave-flash")
  539.          {
  540.             _loc2_ = param1.sharedEvents;
  541.             _loc2_.removeEventListener(SWFBridgeEvent.BRIDGE_NEW_APPLICATION,initSystemManagerCompleteEventHandler);
  542.          }
  543.       }
  544.       
  545.       public function set loadForCompatibility(param1:Boolean) : void
  546.       {
  547.          if(_loadForCompatibility != param1)
  548.          {
  549.             _loadForCompatibility = param1;
  550.             contentChanged = true;
  551.             invalidateProperties();
  552.             invalidateSize();
  553.             invalidateDisplayList();
  554.             dispatchEvent(new Event("loadForCompatibilityChanged"));
  555.          }
  556.       }
  557.       
  558.       override protected function measure() : void
  559.       {
  560.          var _loc1_:Number = NaN;
  561.          var _loc2_:Number = NaN;
  562.          super.measure();
  563.          if(isContentLoaded)
  564.          {
  565.             _loc1_ = mx_internal::contentHolder.scaleX;
  566.             _loc2_ = mx_internal::contentHolder.scaleY;
  567.             mx_internal::contentHolder.scaleX = 1;
  568.             mx_internal::contentHolder.scaleY = 1;
  569.             measuredWidth = contentHolderWidth;
  570.             measuredHeight = contentHolderHeight;
  571.             mx_internal::contentHolder.scaleX = _loc1_;
  572.             mx_internal::contentHolder.scaleY = _loc2_;
  573.          }
  574.          else if(!_source || _source == "")
  575.          {
  576.             measuredWidth = 0;
  577.             measuredHeight = 0;
  578.          }
  579.       }
  580.       
  581.       private function contentLoaderInfo_initEventHandler(param1:Event) : void
  582.       {
  583.          dispatchEvent(param1);
  584.          addInitSystemManagerCompleteListener(LoaderInfo(param1.target).loader.contentLoaderInfo);
  585.       }
  586.       
  587.       public function set autoLoad(param1:Boolean) : void
  588.       {
  589.          if(_autoLoad != param1)
  590.          {
  591.             _autoLoad = param1;
  592.             contentChanged = true;
  593.             invalidateProperties();
  594.             invalidateSize();
  595.             invalidateDisplayList();
  596.             dispatchEvent(new Event("autoLoadChanged"));
  597.          }
  598.       }
  599.       
  600.       private function doScaleLoader() : void
  601.       {
  602.          if(!isContentLoaded)
  603.          {
  604.             return;
  605.          }
  606.          unScaleContent();
  607.          var _loc1_:Number = unscaledWidth;
  608.          var _loc2_:Number = unscaledHeight;
  609.          if(contentHolderWidth > _loc1_ || contentHolderHeight > _loc2_ || !parentAllowsChild)
  610.          {
  611.             mx_internal::contentHolder.scrollRect = new Rectangle(0,0,_loc1_,_loc2_);
  612.          }
  613.          else
  614.          {
  615.             mx_internal::contentHolder.scrollRect = null;
  616.          }
  617.          mx_internal::contentHolder.x = (_loc1_ - contentHolderWidth) * getHorizontalAlignValue();
  618.          mx_internal::contentHolder.y = (_loc2_ - contentHolderHeight) * getVerticalAlignValue();
  619.       }
  620.       
  621.       public function get content() : DisplayObject
  622.       {
  623.          if(mx_internal::contentHolder is Loader)
  624.          {
  625.             return Loader(mx_internal::contentHolder).content;
  626.          }
  627.          return mx_internal::contentHolder;
  628.       }
  629.       
  630.       public function unloadAndStop(param1:Boolean = true) : void
  631.       {
  632.          useUnloadAndStop = true;
  633.          unloadAndStopGC = param1;
  634.          source = null;
  635.          if(!autoLoad)
  636.          {
  637.             load(null);
  638.          }
  639.       }
  640.       
  641.       public function set smoothBitmapContent(param1:Boolean) : void
  642.       {
  643.          if(_smoothBitmapContent != param1)
  644.          {
  645.             _smoothBitmapContent = param1;
  646.             smoothBitmapContentChanged = true;
  647.             invalidateDisplayList();
  648.          }
  649.          dispatchEvent(new Event("smoothBitmapContentChanged"));
  650.       }
  651.       
  652.       private function dispatchInvalidateRequest(param1:Boolean, param2:Boolean, param3:Boolean) : void
  653.       {
  654.          var _loc4_:ISystemManager;
  655.          if(!(_loc4_ = systemManager).useSWFBridge())
  656.          {
  657.             return;
  658.          }
  659.          var _loc5_:IEventDispatcher = _loc4_.swfBridgeGroup.parentBridge;
  660.          var _loc6_:uint = 0;
  661.          if(param1)
  662.          {
  663.             _loc6_ |= InvalidateRequestData.PROPERTIES;
  664.          }
  665.          if(param2)
  666.          {
  667.             _loc6_ |= InvalidateRequestData.SIZE;
  668.          }
  669.          if(param3)
  670.          {
  671.             _loc6_ |= InvalidateRequestData.DISPLAY_LIST;
  672.          }
  673.          var _loc7_:SWFBridgeRequest = new SWFBridgeRequest(SWFBridgeRequest.INVALIDATE_REQUEST,false,false,_loc5_,_loc6_);
  674.          _loc5_.dispatchEvent(_loc7_);
  675.       }
  676.       
  677.       private function contentLoaderInfo_progressEventHandler(param1:ProgressEvent) : void
  678.       {
  679.          _bytesTotal = param1.bytesTotal;
  680.          _bytesLoaded = param1.bytesLoaded;
  681.          dispatchEvent(param1);
  682.       }
  683.       
  684.       public function getVisibleApplicationRect(param1:Boolean = false) : Rectangle
  685.       {
  686.          var _loc2_:Rectangle = getVisibleRect();
  687.          if(param1)
  688.          {
  689.             _loc2_ = systemManager.getVisibleApplicationRect(_loc2_);
  690.          }
  691.          return _loc2_;
  692.       }
  693.       
  694.       public function get showBusyCursor() : Boolean
  695.       {
  696.          return _showBusyCursor;
  697.       }
  698.       
  699.       override public function get baselinePosition() : Number
  700.       {
  701.          if(FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
  702.          {
  703.             return 0;
  704.          }
  705.          return super.baselinePosition;
  706.       }
  707.       
  708.       private function initSystemManagerCompleteEventHandler(param1:Event) : void
  709.       {
  710.          var _loc3_:ISystemManager = null;
  711.          var _loc2_:Object = Object(param1);
  712.          if(mx_internal::contentHolder is Loader && _loc2_.data == Loader(mx_internal::contentHolder).contentLoaderInfo.sharedEvents)
  713.          {
  714.             _swfBridge = Loader(mx_internal::contentHolder).contentLoaderInfo.sharedEvents;
  715.             _loc3_ = systemManager;
  716.             _loc3_.addChildBridge(_swfBridge,this);
  717.             removeInitSystemManagerCompleteListener(Loader(mx_internal::contentHolder).contentLoaderInfo);
  718.             _swfBridge.addEventListener(SWFBridgeRequest.INVALIDATE_REQUEST,invalidateRequestHandler);
  719.          }
  720.       }
  721.       
  722.       [Bindable("complete")]
  723.       public function get bytesTotal() : Number
  724.       {
  725.          return _bytesTotal;
  726.       }
  727.       
  728.       private function getVerticalAlignValue() : Number
  729.       {
  730.          var _loc1_:String = getStyle("verticalAlign");
  731.          if(_loc1_ == "top")
  732.          {
  733.             return 0;
  734.          }
  735.          if(_loc1_ == "bottom")
  736.          {
  737.             return 1;
  738.          }
  739.          return 0.5;
  740.       }
  741.       
  742.       private function contentLoaderInfo_unloadEventHandler(param1:Event) : void
  743.       {
  744.          var _loc2_:ISystemManager = null;
  745.          isContentLoaded = false;
  746.          dispatchEvent(param1);
  747.          if(_swfBridge)
  748.          {
  749.             _swfBridge.removeEventListener(SWFBridgeRequest.INVALIDATE_REQUEST,invalidateRequestHandler);
  750.             _loc2_ = systemManager;
  751.             _loc2_.removeChildBridge(_swfBridge);
  752.             _swfBridge = null;
  753.          }
  754.          if(mx_internal::contentHolder is Loader)
  755.          {
  756.             removeInitSystemManagerCompleteListener(Loader(mx_internal::contentHolder).contentLoaderInfo);
  757.          }
  758.       }
  759.       
  760.       mx_internal function contentLoaderInfo_completeEventHandler(param1:Event) : void
  761.       {
  762.          if(LoaderInfo(param1.target).loader != mx_internal::contentHolder)
  763.          {
  764.             return;
  765.          }
  766.          dispatchEvent(param1);
  767.          contentLoaded();
  768.          if(mx_internal::contentHolder is Loader)
  769.          {
  770.             removeInitSystemManagerCompleteListener(Loader(mx_internal::contentHolder).contentLoaderInfo);
  771.          }
  772.       }
  773.       
  774.       public function set scaleContent(param1:Boolean) : void
  775.       {
  776.          if(_scaleContent != param1)
  777.          {
  778.             _scaleContent = param1;
  779.             scaleContentChanged = true;
  780.             invalidateDisplayList();
  781.          }
  782.          dispatchEvent(new Event("scaleContentChanged"));
  783.       }
  784.       
  785.       private function contentLoaderInfo_openEventHandler(param1:Event) : void
  786.       {
  787.          dispatchEvent(param1);
  788.       }
  789.       
  790.       private function initializeHandler(param1:FlexEvent) : void
  791.       {
  792.          if(contentChanged)
  793.          {
  794.             contentChanged = false;
  795.             if(_autoLoad)
  796.             {
  797.                load(_source);
  798.             }
  799.          }
  800.       }
  801.       
  802.       protected function clickHandler(param1:MouseEvent) : void
  803.       {
  804.          if(!enabled)
  805.          {
  806.             param1.stopImmediatePropagation();
  807.             return;
  808.          }
  809.       }
  810.       
  811.       private function addedToStageHandler(param1:Event) : void
  812.       {
  813.          systemManager.getSandboxRoot().addEventListener(InterManagerRequest.DRAG_MANAGER_REQUEST,mouseShieldHandler,false,0,true);
  814.       }
  815.       
  816.       [Bindable("progress")]
  817.       public function get percentLoaded() : Number
  818.       {
  819.          var _loc1_:Number = isNaN(_bytesTotal) || _bytesTotal == 0 ? Number(0) : Number(100 * (_bytesLoaded / _bytesTotal));
  820.          if(isNaN(_loc1_))
  821.          {
  822.             _loc1_ = 0;
  823.          }
  824.          return _loc1_;
  825.       }
  826.       
  827.       private function doSmoothBitmapContent() : void
  828.       {
  829.          if(content is Bitmap)
  830.          {
  831.             (content as Bitmap).smoothing = _smoothBitmapContent;
  832.          }
  833.       }
  834.       
  835.       public function get swfBridge() : IEventDispatcher
  836.       {
  837.          return _swfBridge;
  838.       }
  839.       
  840.       private function loadContent(param1:Object) : void
  841.       {
  842.          var child:DisplayObject = null;
  843.          var cls:Class = null;
  844.          var url:String = null;
  845.          var byteArray:ByteArray = null;
  846.          var loader:Loader = null;
  847.          var lc:LoaderContext = null;
  848.          var rootURL:String = null;
  849.          var currentDomain:ApplicationDomain = null;
  850.          var topmostDomain:ApplicationDomain = null;
  851.          var message:String = null;
  852.          var classOrString:Object = param1;
  853.          if(classOrString is Class)
  854.          {
  855.             cls = Class(classOrString);
  856.          }
  857.          else if(classOrString is String)
  858.          {
  859.             try
  860.             {
  861.                cls = Class(systemManager.getDefinitionByName(String(classOrString)));
  862.             }
  863.             catch(e:Error)
  864.             {
  865.             }
  866.             url = String(classOrString);
  867.          }
  868.          else if(classOrString is ByteArray)
  869.          {
  870.             byteArray = ByteArray(classOrString);
  871.          }
  872.          else
  873.          {
  874.             url = classOrString.toString();
  875.          }
  876.          if(cls)
  877.          {
  878.             contentHolder = child = new cls();
  879.             addChild(child);
  880.             contentLoaded();
  881.          }
  882.          else if(classOrString is DisplayObject)
  883.          {
  884.             contentHolder = child = DisplayObject(classOrString);
  885.             addChild(child);
  886.             contentLoaded();
  887.          }
  888.          else if(byteArray)
  889.          {
  890.             loader = new FlexLoader();
  891.             contentHolder = child = loader;
  892.             addChild(child);
  893.             loader.contentLoaderInfo.addEventListener(Event.COMPLETE,mx_internal::contentLoaderInfo_completeEventHandler);
  894.             loader.contentLoaderInfo.addEventListener(Event.INIT,contentLoaderInfo_initEventHandler);
  895.             loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,contentLoaderInfo_ioErrorEventHandler);
  896.             loader.contentLoaderInfo.addEventListener(Event.UNLOAD,contentLoaderInfo_unloadEventHandler);
  897.             loader.loadBytes(byteArray,loaderContext);
  898.          }
  899.          else
  900.          {
  901.             if(!url)
  902.             {
  903.                message = resourceManager.getString("controls","notLoadable",[source]);
  904.                throw new Error(message);
  905.             }
  906.             loader = new FlexLoader();
  907.             contentHolder = child = loader;
  908.             addChild(loader);
  909.             loader.contentLoaderInfo.addEventListener(Event.COMPLETE,mx_internal::contentLoaderInfo_completeEventHandler);
  910.             loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS,contentLoaderInfo_httpStatusEventHandler);
  911.             loader.contentLoaderInfo.addEventListener(Event.INIT,contentLoaderInfo_initEventHandler);
  912.             loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,contentLoaderInfo_ioErrorEventHandler);
  913.             loader.contentLoaderInfo.addEventListener(Event.OPEN,contentLoaderInfo_openEventHandler);
  914.             loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,contentLoaderInfo_progressEventHandler);
  915.             loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,contentLoaderInfo_securityErrorEventHandler);
  916.             loader.contentLoaderInfo.addEventListener(Event.UNLOAD,contentLoaderInfo_unloadEventHandler);
  917.             if(Capabilities.isDebugger == true && url.indexOf(".jpg") == -1 && LoaderUtil.normalizeURL(Application.application.systemManager.loaderInfo).indexOf("debug=true") > -1)
  918.             {
  919.                url += url.indexOf("?") > -1 ? "&debug=true" : "?debug=true";
  920.             }
  921.             if(!(url.indexOf(":") > -1 || url.indexOf("/") == 0 || url.indexOf("\\") == 0))
  922.             {
  923.                if(SystemManagerGlobals.bootstrapLoaderInfoURL != null && SystemManagerGlobals.bootstrapLoaderInfoURL != "")
  924.                {
  925.                   rootURL = SystemManagerGlobals.bootstrapLoaderInfoURL;
  926.                }
  927.                else if(root)
  928.                {
  929.                   rootURL = LoaderUtil.normalizeURL(root.loaderInfo);
  930.                }
  931.                else if(systemManager)
  932.                {
  933.                   rootURL = LoaderUtil.normalizeURL(DisplayObject(systemManager).loaderInfo);
  934.                }
  935.                if(rootURL)
  936.                {
  937.                   url = LoaderUtil.createAbsoluteURL(rootURL,url);
  938.                }
  939.             }
  940.             requestedURL = new URLRequest(url);
  941.             lc = loaderContext;
  942.             if(!lc)
  943.             {
  944.                lc = new LoaderContext();
  945.                _loaderContext = lc;
  946.                if(loadForCompatibility)
  947.                {
  948.                   currentDomain = ApplicationDomain.currentDomain.parentDomain;
  949.                   topmostDomain = null;
  950.                   while(currentDomain)
  951.                   {
  952.                      topmostDomain = currentDomain;
  953.                      currentDomain = currentDomain.parentDomain;
  954.                   }
  955.                   lc.applicationDomain = new ApplicationDomain(topmostDomain);
  956.                }
  957.                if(trustContent)
  958.                {
  959.                   lc.securityDomain = SecurityDomain.currentDomain;
  960.                }
  961.                else if(!loadForCompatibility)
  962.                {
  963.                   attemptingChildAppDomain = true;
  964.                   lc.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
  965.                }
  966.             }
  967.             loader.load(requestedURL,lc);
  968.          }
  969.          invalidateDisplayList();
  970.       }
  971.       
  972.       public function get contentWidth() : Number
  973.       {
  974.          return !!mx_internal::contentHolder ? Number(mx_internal::contentHolder.width) : Number(NaN);
  975.       }
  976.       
  977.       [Bindable("scaleContentChanged")]
  978.       public function get scaleContent() : Boolean
  979.       {
  980.          return _scaleContent;
  981.       }
  982.       
  983.       public function get childAllowsParent() : Boolean
  984.       {
  985.          if(!isContentLoaded)
  986.          {
  987.             return false;
  988.          }
  989.          try
  990.          {
  991.             if(mx_internal::contentHolder is Loader)
  992.             {
  993.                return Loader(mx_internal::contentHolder).contentLoaderInfo.childAllowsParent;
  994.             }
  995.          }
  996.          catch(error:Error)
  997.          {
  998.             return false;
  999.          }
  1000.          return true;
  1001.       }
  1002.       
  1003.       override protected function commitProperties() : void
  1004.       {
  1005.          super.commitProperties();
  1006.          if(contentChanged)
  1007.          {
  1008.             contentChanged = false;
  1009.             if(_autoLoad)
  1010.             {
  1011.                load(_source);
  1012.             }
  1013.          }
  1014.       }
  1015.       
  1016.       private function contentLoaderInfo_securityErrorEventHandler(param1:SecurityErrorEvent) : void
  1017.       {
  1018.          var _loc2_:LoaderContext = null;
  1019.          if(attemptingChildAppDomain)
  1020.          {
  1021.             attemptingChildAppDomain = false;
  1022.             _loc2_ = new LoaderContext();
  1023.             _loaderContext = _loc2_;
  1024.             callLater(load);
  1025.             return;
  1026.          }
  1027.          dispatchEvent(param1);
  1028.          if(mx_internal::contentHolder is Loader)
  1029.          {
  1030.             removeInitSystemManagerCompleteListener(Loader(mx_internal::contentHolder).contentLoaderInfo);
  1031.          }
  1032.       }
  1033.       
  1034.       private function sizeShield() : void
  1035.       {
  1036.          if(mouseShield && mouseShield.parent)
  1037.          {
  1038.             mouseShield.width = unscaledWidth;
  1039.             mouseShield.height = unscaledHeight;
  1040.          }
  1041.       }
  1042.       
  1043.       private function addInitSystemManagerCompleteListener(param1:LoaderInfo) : void
  1044.       {
  1045.          var _loc2_:EventDispatcher = null;
  1046.          if(param1.contentType == "application/x-shockwave-flash")
  1047.          {
  1048.             _loc2_ = param1.sharedEvents;
  1049.             _loc2_.addEventListener(SWFBridgeEvent.BRIDGE_NEW_APPLICATION,initSystemManagerCompleteEventHandler);
  1050.          }
  1051.       }
  1052.       
  1053.       private function invalidateRequestHandler(param1:Event) : void
  1054.       {
  1055.          if(param1 is SWFBridgeRequest)
  1056.          {
  1057.             return;
  1058.          }
  1059.          var _loc2_:SWFBridgeRequest = SWFBridgeRequest.marshal(param1);
  1060.          var _loc3_:uint = uint(_loc2_.data);
  1061.          if(_loc3_ & InvalidateRequestData.PROPERTIES)
  1062.          {
  1063.             invalidateProperties();
  1064.          }
  1065.          if(_loc3_ & InvalidateRequestData.SIZE)
  1066.          {
  1067.             invalidateSize();
  1068.          }
  1069.          if(_loc3_ & InvalidateRequestData.DISPLAY_LIST)
  1070.          {
  1071.             invalidateDisplayList();
  1072.          }
  1073.          dispatchInvalidateRequest((_loc3_ & InvalidateRequestData.PROPERTIES) != 0,(_loc3_ & InvalidateRequestData.SIZE) != 0,(_loc3_ & InvalidateRequestData.DISPLAY_LIST) != 0);
  1074.       }
  1075.       
  1076.       private function contentLoaded() : void
  1077.       {
  1078.          var loaderInfo:LoaderInfo = null;
  1079.          isContentLoaded = true;
  1080.          if(mx_internal::contentHolder is Loader)
  1081.          {
  1082.             loaderInfo = Loader(mx_internal::contentHolder).contentLoaderInfo;
  1083.          }
  1084.          resizableContent = false;
  1085.          if(loaderInfo)
  1086.          {
  1087.             if(loaderInfo.contentType == "application/x-shockwave-flash")
  1088.             {
  1089.                resizableContent = true;
  1090.             }
  1091.             if(resizableContent)
  1092.             {
  1093.                try
  1094.                {
  1095.                   if(Loader(mx_internal::contentHolder).content is IFlexDisplayObject)
  1096.                   {
  1097.                      flexContent = true;
  1098.                   }
  1099.                   else
  1100.                   {
  1101.                      flexContent = swfBridge != null;
  1102.                   }
  1103.                }
  1104.                catch(e:Error)
  1105.                {
  1106.                   flexContent = swfBridge != null;
  1107.                }
  1108.             }
  1109.          }
  1110.          try
  1111.          {
  1112.             if(tabChildren && mx_internal::contentHolder is Loader && (loaderInfo.contentType == "application/x-shockwave-flash" || Loader(mx_internal::contentHolder).content is DisplayObjectContainer))
  1113.             {
  1114.                Loader(mx_internal::contentHolder).tabChildren = true;
  1115.                DisplayObjectContainer(Loader(mx_internal::contentHolder).content).tabChildren = true;
  1116.             }
  1117.          }
  1118.          catch(e:Error)
  1119.          {
  1120.          }
  1121.          invalidateSize();
  1122.          invalidateDisplayList();
  1123.       }
  1124.       
  1125.       private function getContentSize() : Point
  1126.       {
  1127.          var _loc3_:IEventDispatcher = null;
  1128.          var _loc4_:SWFBridgeRequest = null;
  1129.          var _loc1_:Point = new Point();
  1130.          if(!mx_internal::contentHolder is Loader)
  1131.          {
  1132.             return _loc1_;
  1133.          }
  1134.          var _loc2_:Loader = Loader(mx_internal::contentHolder);
  1135.          if(_loc2_.contentLoaderInfo.childAllowsParent)
  1136.          {
  1137.             _loc1_.x = _loc2_.content.width;
  1138.             _loc1_.y = _loc2_.content.height;
  1139.          }
  1140.          else
  1141.          {
  1142.             _loc3_ = swfBridge;
  1143.             if(_loc3_)
  1144.             {
  1145.                _loc4_ = new SWFBridgeRequest(SWFBridgeRequest.GET_SIZE_REQUEST);
  1146.                _loc3_.dispatchEvent(_loc4_);
  1147.                _loc1_.x = _loc4_.data.width;
  1148.                _loc1_.y = _loc4_.data.height;
  1149.             }
  1150.          }
  1151.          if(_loc1_.x == 0)
  1152.          {
  1153.             _loc1_.x = _loc2_.contentLoaderInfo.width;
  1154.          }
  1155.          if(_loc1_.y == 0)
  1156.          {
  1157.             _loc1_.y = _loc2_.contentLoaderInfo.height;
  1158.          }
  1159.          return _loc1_;
  1160.       }
  1161.       
  1162.       public function load(param1:Object = null) : void
  1163.       {
  1164.          var imageData:Bitmap = null;
  1165.          var request:SWFBridgeEvent = null;
  1166.          var url:Object = param1;
  1167.          if(url)
  1168.          {
  1169.             _source = url;
  1170.          }
  1171.          if(mx_internal::contentHolder)
  1172.          {
  1173.             if(isContentLoaded)
  1174.             {
  1175.                if(mx_internal::contentHolder is Loader)
  1176.                {
  1177.                   try
  1178.                   {
  1179.                      if(Loader(mx_internal::contentHolder).content is Bitmap)
  1180.                      {
  1181.                         imageData = Bitmap(Loader(mx_internal::contentHolder).content);
  1182.                         if(imageData.bitmapData)
  1183.                         {
  1184.                            imageData.bitmapData = null;
  1185.                         }
  1186.                      }
  1187.                   }
  1188.                   catch(error:Error)
  1189.                   {
  1190.                   }
  1191.                   if(_swfBridge)
  1192.                   {
  1193.                      request = new SWFBridgeEvent(SWFBridgeEvent.BRIDGE_APPLICATION_UNLOADING,false,false,_swfBridge);
  1194.                      _swfBridge.dispatchEvent(request);
  1195.                   }
  1196.                   if(useUnloadAndStop && "unloadAndStop" in mx_internal::contentHolder)
  1197.                   {
  1198.                      mx_internal::contentHolder["unloadAndStop"](unloadAndStopGC);
  1199.                   }
  1200.                   else
  1201.                   {
  1202.                      Loader(mx_internal::contentHolder).unload();
  1203.                   }
  1204.                   if(!explicitLoaderContext)
  1205.                   {
  1206.                      _loaderContext = null;
  1207.                   }
  1208.                }
  1209.                else if(mx_internal::contentHolder is Bitmap)
  1210.                {
  1211.                   imageData = Bitmap(mx_internal::contentHolder);
  1212.                   if(imageData.bitmapData)
  1213.                   {
  1214.                      imageData.bitmapData = null;
  1215.                   }
  1216.                }
  1217.             }
  1218.             else if(mx_internal::contentHolder is Loader)
  1219.             {
  1220.                try
  1221.                {
  1222.                   Loader(mx_internal::contentHolder).close();
  1223.                }
  1224.                catch(error:Error)
  1225.                {
  1226.                }
  1227.             }
  1228.             try
  1229.             {
  1230.                if(mx_internal::contentHolder.parent == this)
  1231.                {
  1232.                   removeChild(mx_internal::contentHolder);
  1233.                }
  1234.             }
  1235.             catch(error:Error)
  1236.             {
  1237.                try
  1238.                {
  1239.                   removeChild(mx_internal::contentHolder);
  1240.                }
  1241.                catch(error1:Error)
  1242.                {
  1243.                }
  1244.             }
  1245.             contentHolder = null;
  1246.          }
  1247.          isContentLoaded = false;
  1248.          brokenImage = false;
  1249.          useUnloadAndStop = false;
  1250.          if(!_source || _source == "")
  1251.          {
  1252.             return;
  1253.          }
  1254.          loadContent(_source);
  1255.       }
  1256.       
  1257.       public function get parentAllowsChild() : Boolean
  1258.       {
  1259.          if(!isContentLoaded)
  1260.          {
  1261.             return false;
  1262.          }
  1263.          try
  1264.          {
  1265.             if(mx_internal::contentHolder is Loader)
  1266.             {
  1267.                return Loader(mx_internal::contentHolder).contentLoaderInfo.parentAllowsChild;
  1268.             }
  1269.          }
  1270.          catch(error:Error)
  1271.          {
  1272.             return false;
  1273.          }
  1274.          return true;
  1275.       }
  1276.       
  1277.       private function contentLoaderInfo_ioErrorEventHandler(param1:IOErrorEvent) : void
  1278.       {
  1279.          source = getStyle("brokenImageSkin");
  1280.          load();
  1281.          contentChanged = false;
  1282.          brokenImage = true;
  1283.          if(hasEventListener(param1.type))
  1284.          {
  1285.             dispatchEvent(param1);
  1286.          }
  1287.          if(mx_internal::contentHolder is Loader)
  1288.          {
  1289.             removeInitSystemManagerCompleteListener(Loader(mx_internal::contentHolder).contentLoaderInfo);
  1290.          }
  1291.       }
  1292.       
  1293.       override protected function updateDisplayList(param1:Number, param2:Number) : void
  1294.       {
  1295.          var _loc3_:Class = null;
  1296.          super.updateDisplayList(param1,param2);
  1297.          if(contentChanged)
  1298.          {
  1299.             contentChanged = false;
  1300.             if(_autoLoad)
  1301.             {
  1302.                load(_source);
  1303.             }
  1304.          }
  1305.          if(isContentLoaded)
  1306.          {
  1307.             if(_scaleContent && !brokenImage)
  1308.             {
  1309.                doScaleContent();
  1310.             }
  1311.             else
  1312.             {
  1313.                doScaleLoader();
  1314.             }
  1315.             scaleContentChanged = false;
  1316.             if(smoothBitmapContentChanged)
  1317.             {
  1318.                doSmoothBitmapContent();
  1319.                smoothBitmapContentChanged = false;
  1320.             }
  1321.          }
  1322.          if(brokenImage && !brokenImageBorder)
  1323.          {
  1324.             _loc3_ = getStyle("brokenImageBorderSkin");
  1325.             if(_loc3_)
  1326.             {
  1327.                brokenImageBorder = IFlexDisplayObject(new _loc3_());
  1328.                if(brokenImageBorder is ISimpleStyleClient)
  1329.                {
  1330.                   ISimpleStyleClient(brokenImageBorder).styleName = this;
  1331.                }
  1332.                addChild(DisplayObject(brokenImageBorder));
  1333.             }
  1334.          }
  1335.          else if(!brokenImage && brokenImageBorder)
  1336.          {
  1337.             removeChild(DisplayObject(brokenImageBorder));
  1338.             brokenImageBorder = null;
  1339.          }
  1340.          if(brokenImageBorder)
  1341.          {
  1342.             brokenImageBorder.setActualSize(param1,param2);
  1343.          }
  1344.          sizeShield();
  1345.       }
  1346.       
  1347.       private function mouseShieldHandler(param1:Event) : void
  1348.       {
  1349.          if(param1["name"] != "mouseShield")
  1350.          {
  1351.             return;
  1352.          }
  1353.          if(!isContentLoaded || parentAllowsChild)
  1354.          {
  1355.             return;
  1356.          }
  1357.          if(param1["value"])
  1358.          {
  1359.             if(!mouseShield)
  1360.             {
  1361.                mouseShield = new Sprite();
  1362.                mouseShield.graphics.beginFill(0,0);
  1363.                mouseShield.graphics.drawRect(0,0,100,100);
  1364.                mouseShield.graphics.endFill();
  1365.             }
  1366.             if(!mouseShield.parent)
  1367.             {
  1368.                addChild(mouseShield);
  1369.             }
  1370.             sizeShield();
  1371.          }
  1372.          else if(mouseShield && mouseShield.parent)
  1373.          {
  1374.             removeChild(mouseShield);
  1375.          }
  1376.       }
  1377.    }
  1378. }
  1379.